package com.sbk.xuanliu.enums;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: 孙壁凯
 * @Date: 2021/11/03/15:33
 * @Description:
 */
public enum ReturnCode {
    error(2001,"系统繁忙，请稍后再试！"),
    ok(200,"操作成功");
    int code;
    String status;

    // 普通方法
    public static String getName(int index) {
        for (ReturnCode c : ReturnCode.values()) {
            if (c.getCode() == index) {
                return c.status;
            }
        }
        return null;
    }

    ReturnCode(int code, String status) {
        this.code = code;
        this.status = status;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
